//class ModuleLoader
    
    export  class ModuleLoader /* flash.events.EventDispatcher */
    {
       

        public load(arg1: string, arg2: Object /* flash.system.LoaderContext */=null): void
        {
            if (this._url != arg1) 
            {
                this._url = arg1;
                if (this._loader != null) 
                {
                    this._loader.contentLoaderInfo.removeEventListener(flash.events.Event.INIT, this.onInitHandler);
                    this._loader.contentLoaderInfo.removeEventListener(flash.events.Event.COMPLETE, this.onCompleteHandler);
                    this._loader.contentLoaderInfo.removeEventListener(flash.events.ProgressEvent.PROGRESS, this.onProgressHandler);
                    this._loader.contentLoaderInfo.removeEventListener(flash.events.IOErrorEvent.IO_ERROR, this.onIOErrorHandler);
                }
                else 
                {
                    this._loader = new Object /* flash.display.Loader */();
                }
                this._loader.contentLoaderInfo.addEventListener(flash.events.Event.INIT, this.onInitHandler);
                this._loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.onCompleteHandler);
                this._loader.contentLoaderInfo.addEventListener(flash.events.ProgressEvent.PROGRESS, this.onProgressHandler);
                this._loader.contentLoaderInfo.addEventListener(flash.events.IOErrorEvent.IO_ERROR, this.onIOErrorHandler);
                this._loader.load(new Object /* flash.net.URLRequest */(this._url), arg2);
            }
            return;
        }

        /* internal  */onInitHandler(arg1: Object /* flash.events.Event */): void
        {
            this._loaderInfo = this._loader.contentLoaderInfo;
            this._appDomain = this._loaderInfo.applicationDomain;
            return;
        }

        /* internal  */onCompleteHandler(arg1: Object /* flash.events.Event */): void
        {
            this._loader.contentLoaderInfo.removeEventListener(flash.events.Event.INIT, this.onInitHandler);
            this._loader.contentLoaderInfo.removeEventListener(flash.events.Event.COMPLETE, this.onCompleteHandler);
            this._loader.contentLoaderInfo.removeEventListener(flash.events.ProgressEvent.PROGRESS, this.onProgressHandler);
            this._loader.contentLoaderInfo.removeEventListener(flash.events.IOErrorEvent.IO_ERROR, this.onIOErrorHandler);
            dispatchEvent(arg1);
            return;
        }

        /* internal  */onProgressHandler(arg1: Object /* flash.events.ProgressEvent */): void
        {
            dispatchEvent(arg1);
            return;
        }

        /* internal  */onIOErrorHandler(arg1: Object /* flash.events.IOErrorEvent */): void
        {
            dispatchEvent(arg1);
            return;
        }

        public dispose(): void
        {
            this._loader.contentLoaderInfo.removeEventListener(flash.events.Event.INIT, this.onInitHandler);
            this._loader.contentLoaderInfo.removeEventListener(flash.events.Event.COMPLETE, this.onCompleteHandler);
            this._loader.contentLoaderInfo.removeEventListener(flash.events.ProgressEvent.PROGRESS, this.onProgressHandler);
            this._loader.contentLoaderInfo.removeEventListener(flash.events.IOErrorEvent.IO_ERROR, this.onIOErrorHandler);
            this._loader.unload();
            this._loader = null;
            this._url = null;
            return;
        }

        public get url(): string
        {
            return this._url;
        }

        public get content(): Object /* flash.display.DisplayObject */
        {
            if (this._loaderInfo) 
            {
                return this._loaderInfo.content;
            }
            return null;
        }

        public get contentType(): string
        {
            if (this._loaderInfo) 
            {
                return this._loaderInfo.contentType;
            }
            return null;
        }

        public get loaderInfo(): Object /* flash.display.LoaderInfo */
        {
            return this._loaderInfo;
        }

        public getExportedAsset(arg1: string): Object
        {
            if (null == this._appDomain) 
            {
                throw new Error("not initialized");
            }
            var loc1=this.getAssetClass(arg1);
            if (loc1 != null) 
            {
                return new loc1();
            }
            return null;
        }

        public getAssetClass(arg1: string): Class
        {
            if (null == this._appDomain) 
            {
                throw new Error("not initialized");
            }
            if (this._appDomain.hasDefinition(arg1)) 
            {
                return this._appDomain.getDefinition(arg1) as Class;
            }
            return null;
        }

        private /* var */_url: string;

        private /* var */_loader: Object /* flash.display.Loader */;

        private /* var */_contentType: string;

        private /* var */_loaderInfo: Object /* flash.display.LoaderInfo */;

        protected /* var */_appDomain: Object /* flash.system.ApplicationDomain */;
    }
